﻿#pragma once
#include <QObject>
#include <opencv2/opencv.hpp>
#include <QVector>
#include "calibrator_data.h"

class CameraCalibrator
{
public:
	CameraCalibrator();
	~CameraCalibrator();
	bool SetSavePath(const QString& path);
	bool InitCameraParam(const QString& parampath);

	bool Calculate(QVector<BDInfo>& datas);

private:
	Position BackProjectionPixToPhyXY(const Position& pix);
	void SaveResult(const cv::Mat& param);
private:
	cv::Mat m_cameraMatri;
	cv::Mat m_distCoeffs;

	QVector<Position> m_pix;
	QVector<Position> m_rob;

	QString m_path;
};
